function send()
strComputer="."
str="{"
'On Error Resume Next
i=0
Set objWMIService = GetObject( "winmgmts://" & strComputer & "/root/cimv2" )
'If Err Then ShowError
Set colItems = objWMIService.ExecQuery("SELECT DeviceID,LoadPercentage
FROM Win32_Processor", "WQL", _
                                         wbemFlagReturnImmediately +
wbemFlagForwardOnly)
For Each objItem In colItems
                       str=str & chr(34) &  objItem.DeviceID  & chr(34) & ":"
                       str=str & chr(34) & objItem.LoadPercentage & chr(34)

                       if i=0 then  str=str & ","
       i=i+1
       Next

                  str=str & "}"
'Wscript.Echo "" & str

URL ="http://localhost:8080/restful/res/helloworld?json=" & str & "&"
& "i=" & i & "&" & "machineid=" & "vipul"
'Wscript.Echo "" & URL
Set WshShell = WScript.CreateObject("WScript.Shell")

Set http = CreateObject("MSXML2.XmlHttp")
http.open "GET", URL, FALSE
http.setRequestHeader "Content-Type","'application/soap+xml; charset=utf-8'."
http.setRequestHeader "Content-Length", "255"
'data=http.setRequestHeader( "vipul", "Value" )
http.send "null"
'Wscript.Echo "http readyState" & http.readyState
'Wscript.Echo "http status " & http.status
'Wscript.Echo "http response " & http.responseText

set WshShell = nothing
set http = nothing
end function


i=0
while i<=1000
Wscript.sleep(1000*5)
send
wend

id="vipul"
URL ="http://localhost:8080/restful/res/helloworld?json=" & "{" &
chr(34) & "machineid" & chr(34) & ":" & chr(34) & id & chr(34) & "}"
Wscript.Echo "" & URL
Set WshShell = WScript.CreateObject("WScript.Shell")

Set http = CreateObject("MSXML2.XmlHttp")
http.open "GET", URL, FALSE
http.setRequestHeader "Content-Type","'application/soap+xml; charset=utf-8'."
http.setRequestHeader "Content-Length", "255"
http.send "null"
'Wscript.Echo "http readyState" & http.readyState
'Wscript.Echo "http status " & http.status
'Wscript.Echo "http response " & http.responseText

set WshShell = nothing
set http = nothing

